<template>
	<div class="card-page">
		<tool-bar nav="" :title="'K8s External-Service'">
			<el-button size="small" @click="ok_click" type="primary"> 设置</el-button>
		</tool-bar>

		<el-row :gutter="12" type="flex">
			<el-col :span="12">
				<el-card shadow="always">

                    <template #header> <span>本</span> </template>

					<kv label="名称空间">
						<el-input v-model="info.namespace" chk="*"/>
					</kv>
					<kv label="名称">
						<el-input v-model="info.name" chk="*"/>
					</kv>
				</el-card>
			</el-col>
			<el-col :span="12">

				<el-card shadow="always">
                    <template #header> <span>源</span> </template>

					<kv label="名称空间">
						<el-input v-model="info.sourceNamespace" chk="*"/>
					</kv>
				</el-card>
			</el-col>
		</el-row>
	</div>
</template>

<script setup>
/**
 * Created by CodeGenerator  at 2021-03-15 10:31:23
 */




//定义 vue2的this,当前组件
const $self = getCurrentInstance();

//定义 $attrs
const $attrs = useAttrs();



//定义data
const $data = reactive({"info":{"fillNancalFeign":""}});
const info = $computed(()=> $data.info );

const $props = defineProps({
    action: { type: String } ,
    id : { type: String }
});


const list = ref();

//定义事件
const $emit = defineEmits(["update:modelValue","loaded"]);


const action_name = $computed( function() {
    return {add: "添加", edit: "修改"}[$props.action]
});

const ok_click = function() {
//校验
    if (jv.chk_main() == false) {
        return;
    }
    var url =  "/ops/k8s/gateway-route-define/add"
    jv.$http.post(url, $data.info).then(res => {
        jv.info("添加成功");
    })
};

onMounted( function() {
} )



</script>
